package com.grass.p019lv.game.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.UiUtils;
import com.grass.p019lv.game.bean.GameBean;

/* renamed from: com.grass.lv.game.adapter.GameAdapter */
public class GameAdapter extends BaseRecyclerAdapter<GameBean, Holder> {
    public void MyHolder(Holder holder, int i) {
        holder.setData((GameBean) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_game, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.grass.lv.game.adapter.GameAdapter$Holder */
    public class Holder extends BaseRecyclerHolder {
        ImageView iv_cover;
        LinearLayout ll_root;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.iv_cover = (ImageView) view.findViewById(R.id.iv_cover);
            this.tv_title = (TextView) view.findViewById(R.id.tv_title);
            this.ll_root = (LinearLayout) view.findViewById(R.id.ll_root);
            ViewGroup.LayoutParams layoutParams = this.iv_cover.getLayoutParams();
            layoutParams.height = (((UiUtils.getWindowWidth() - UiUtils.dp2px(28)) / 2) * 108) / 191;
            this.iv_cover.setLayoutParams(layoutParams);
        }

        public void setData(GameBean gameBean, int i) {
            this.tv_title.setText(gameBean.getName());
            GlideUtils.loadResId(gameBean.getCover(), this.iv_cover);
        }
    }
}
